equal
deleted
inserted
replaced
72 username = platform.username |
72 username = platform.username |
73 |
73 |
74 # Python compatibility |
74 # Python compatibility |
75 |
75 |
76 def sha1(s=''): |
76 def sha1(s=''): |
|
77 ''' |
|
78 Low-overhead wrapper around Python's SHA support |
|
79 |
|
80 >>> f = _fastsha1 |
|
81 >>> a = sha1() |
|
82 >>> a = f() |
|
83 >>> a.hexdigest() |
|
84 'da39a3ee5e6b4b0d3255bfef95601890afd80709' |
|
85 ''' |
|
86 |
77 return _fastsha1(s) |
87 return _fastsha1(s) |
78 |
88 |
79 _notset = object() |
89 _notset = object() |
80 def safehasattr(thing, attr): |
90 def safehasattr(thing, attr): |
81 return getattr(thing, attr, _notset) is not _notset |
91 return getattr(thing, attr, _notset) is not _notset |