3 ms·
Heh, you made me consider if kudeki-chain also restricted the range (though not to a constant): One could read the title as exactly n leading zeros, but of cou
by hyperpallium 7y ago
Heh, you made me consider if kudeki-chain also restricted the range (though not to a constant):
One could read the title as exactly n leading zeros, but of course, it just means it has n leading zeros (that is, it may have more, too) - and the py code is implemented that way. So, for example, if you started with 16 leading zeros, it could be used for the first 16 commits.
work = len(sha1) - len(sha1.lstrip('0'))
...
assert commit_num <= work, "Not enough work done."
https://github.com/seungwonpark/kudeki-chain/blob/master/manage.py https://github.com/seungwonpark/kudeki-chain/blob/master/man...
BTW cute that assert is exactly appropriate for the ci tests, for determining whether it is accepted as a commit.