js-adler32/bin/adler32.py
SheetJS b692b3f7df version bump 0.4.0
- simplified utf8 code
- added browser demo
- added command line tool adler32
- fixed unicode baseline script (node 6 changed default array printing)
- fixed performance tests (benchmark module changed behavior)
- updated travis versions for test
- miscellaneous adjustments to tooling
2016-06-16 12:56:55 -04:00

16 lines
379 B
Python
Executable File

#!/usr/bin/env python
# adler32.py -- calculate adler32 checksum of data
# Copyright (C) 2016-present SheetJS
from zlib import adler32
from sys import argv, stdin
args=argv[1:]
payload=""
if len(args) == 0 or args[0] == "-":
payload = stdin.read()
else:
payload = open(args[0],"rb").read()
# NOTE: python 2 returns a signed value; python3 is unsigned
print adler32(payload)