Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # CRC32 Stream
  2. crc32-stream is a streaming CRC32 checksumer. It uses the [crc](https://www.npmjs.org/package/crc) module behind the scenes to reliably handle binary data and fancy character sets. Data is passed through untouched.
  3. ### Install
  4. ```bash
  5. npm install crc32-stream --save
  6. ```
  7. You can also use `npm install https://github.com/archiverjs/node-crc32-stream/archive/master.tar.gz` to test upcoming versions.
  8. ### Usage
  9. #### CRC32Stream
  10. Inherits [Transform Stream](http://nodejs.org/api/stream.html#stream_class_stream_transform) options and methods.
  11. ```js
  12. const {CRC32Stream} = require('crc32-stream');
  13. const source = fs.createReadStream('file.txt');
  14. const checksum = new CRC32Stream();
  15. checksum.on('end', function(err) {
  16. // do something with checksum.digest() here
  17. });
  18. // either pipe it
  19. source.pipe(checksum);
  20. // or write it
  21. checksum.write('string');
  22. checksum.end();
  23. ```
  24. #### DeflateCRC32Stream
  25. Inherits [zlib.DeflateRaw](http://nodejs.org/api/zlib.html#zlib_class_zlib_deflateraw) options and methods.
  26. ```js
  27. const {DeflateCRC32Stream} = require('crc32-stream');
  28. const source = fs.createReadStream('file.txt');
  29. const checksum = new DeflateCRC32Stream();
  30. checksum.on('end', function(err) {
  31. // do something with checksum.digest() here
  32. });
  33. // either pipe it
  34. source.pipe(checksum);
  35. // or write it
  36. checksum.write('string');
  37. checksum.end();
  38. ```
  39. ### Instance API
  40. #### digest()
  41. Returns the checksum digest in unsigned form.
  42. #### hex()
  43. Returns the hexadecimal representation of the checksum digest. (ie E81722F0)
  44. #### size(compressed)
  45. Returns the raw size/length of passed-through data.
  46. If `compressed` is `true`, it returns compressed length instead. (DeflateCRC32Stream)
  47. ## Things of Interest
  48. - [Changelog](https://github.com/archiverjs/node-crc32-stream/releases)
  49. - [Contributing](https://github.com/archiverjs/node-crc32-stream/blob/master/CONTRIBUTING.md)
  50. - [MIT License](https://github.com/archiverjs/node-crc32-stream/blob/master/LICENSE-MIT)