SheetJS
b692b3f7df
- 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
16 lines
379 B
Python
Executable File
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)
|