Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@@ -1,3 +1,8 @@ | ||
# OpenTimestamps | ||
|
||
A hash-chain-based timestamping system. | ||
|
||
# Requirements | ||
|
||
Python (>=2.7.0) | ||
PyCrypto (>=0.5) |
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/python | ||
# Copyright (C) 2012 Peter Todd <pete@petertodd.org> | ||
# | ||
# This file is part of OpenTimestamps. | ||
# | ||
# OpenTimestamps is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU Affero General Public License as published by the | ||
# Free Software Foundation; either version 3 of the License, or (at your | ||
# option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more | ||
# details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import sys | ||
if sys.version_info[1] < 7: | ||
sys.exit("OpenTimestamps requires Python version 2.7.0 or newer. "\ | ||
"(you have %d.%d.%d)"%sys.version_info[0:3]) | ||
|
||
import Crypto.Hash.SHA256 as chash | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser(description="OpenTimestamps client") | ||
verbosity_group = parser.add_mutually_exclusive_group() | ||
verbosity_group.add_argument("-v","--verbose",action="store_true", | ||
help="be verbose") | ||
verbosity_group.add_argument("-q","--quiet",action="store_true", | ||
help="be quiet") | ||
|
||
args = parser.parse_args() | ||
|
||
print 'args: ',args | ||
|
||
h = chash.new() | ||
|
||
in_fd = sys.stdin | ||
|
||
while True: | ||
d = in_fd.read(4096) | ||
if d == '': | ||
break | ||
h.update(d) | ||
print h.hexdigest() |