727e2055 MT |
1 | # -*- coding: utf-8 -*- |
2 | |
3 | # Copyright © 2008 - Steve Frécinaux |
4 | # License: LGPL 2 |
5 | |
6 | __all__ = ['issha1'] |
7 | |
8 | import re |
9 | |
10 | SHA1_PATTERN = re.compile('^[a-f0-9]{40}$') |
11 | |
12 | def issha1(s): |
13 | return SHA1_PATTERN.match(s) is not None |