avro-crc64
v0.1.0
Published
Rabin 64 bit crc fingerprint for AVRO Single-object encoding
Downloads
1,830
Readme
avro-crc64
Features
- Computes the 64-bit AVRO fingerprint for a given AVRO schema string
Installation
npm install avro-crc64
Documentation
Examples
const { fingerprint64AvroSchema } = require('avro-crc64');
const avroSchemaExample = {
type: 'record',
name: 'Example',
doc: 'Simple example avro schema',
fields: [
{
name: 'foobar',
type: 'string',
doc: 'foobar is all about barbazz',
},
],
};
fingerprint64AvroSchema(JSON.stringify(avroSchemaExample))
.then((uint8) => {
const hexFingerprint = Buffer.from(uint8.buffer).toString('hex');
return console.log(hexFingerprint); // logs "b75d6f7da238cf70"
})
;```