| OLD | NEW |
| 1 # | 1 # |
| 2 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundat
ion | 2 # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons F
oundation |
| 3 # | 3 # |
| 4 # Permission is hereby granted, free of charge, to any person obtaining | 4 # Permission is hereby granted, free of charge, to any person obtaining |
| 5 # a copy of this software and associated documentation files (the | 5 # a copy of this software and associated documentation files (the |
| 6 # "Software"), to deal in the Software without restriction, including | 6 # "Software"), to deal in the Software without restriction, including |
| 7 # without limitation the rights to use, copy, modify, merge, publish, | 7 # without limitation the rights to use, copy, modify, merge, publish, |
| 8 # distribute, sublicense, and/or sell copies of the Software, and to | 8 # distribute, sublicense, and/or sell copies of the Software, and to |
| 9 # permit persons to whom the Software is furnished to do so, subject to | 9 # permit persons to whom the Software is furnished to do so, subject to |
| 10 # the following conditions: | 10 # the following conditions: |
| 11 # | 11 # |
| 12 # The above copyright notice and this permission notice shall be included | 12 # The above copyright notice and this permission notice shall be included |
| (...skipping 11 matching lines...) Expand all Loading... |
| 24 __doc__ = """ | 24 __doc__ = """ |
| 25 hashlib backwards-compatibility module for older (pre-2.5) Python versions | 25 hashlib backwards-compatibility module for older (pre-2.5) Python versions |
| 26 | 26 |
| 27 This does not not NOT (repeat, *NOT*) provide complete hashlib | 27 This does not not NOT (repeat, *NOT*) provide complete hashlib |
| 28 functionality. It only wraps the portions of MD5 functionality used | 28 functionality. It only wraps the portions of MD5 functionality used |
| 29 by SCons, in an interface that looks like hashlib (or enough for our | 29 by SCons, in an interface that looks like hashlib (or enough for our |
| 30 purposes, anyway). In fact, this module will raise an ImportError if | 30 purposes, anyway). In fact, this module will raise an ImportError if |
| 31 the underlying md5 module isn't available. | 31 the underlying md5 module isn't available. |
| 32 """ | 32 """ |
| 33 | 33 |
| 34 __revision__ = "src/engine/SCons/compat/_scons_hashlib.py 3842 2008/12/20 22:59:
52 scons" | 34 __revision__ = "src/engine/SCons/compat/_scons_hashlib.py 3897 2009/01/13 06:45:
54 scons" |
| 35 | 35 |
| 36 import md5 | 36 import md5 |
| 37 import string | 37 import string |
| 38 | 38 |
| 39 class md5obj: | 39 class md5obj: |
| 40 | 40 |
| 41 md5_module = md5 | 41 md5_module = md5 |
| 42 | 42 |
| 43 def __init__(self, name, string=''): | 43 def __init__(self, name, string=''): |
| 44 if not name in ('MD5', 'md5'): | 44 if not name in ('MD5', 'md5'): |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 r = '' | 76 r = '' |
| 77 for c in self.digest(): | 77 for c in self.digest(): |
| 78 i = ord(c) | 78 i = ord(c) |
| 79 r = r + h[(i >> 4) & 0xF] + h[i & 0xF] | 79 r = r + h[(i >> 4) & 0xF] + h[i & 0xF] |
| 80 return r | 80 return r |
| 81 | 81 |
| 82 new = md5obj | 82 new = md5obj |
| 83 | 83 |
| 84 def md5(string=''): | 84 def md5(string=''): |
| 85 return md5obj('md5', string) | 85 return md5obj('md5', string) |
| OLD | NEW |