28 lines
652 B
JavaScript
28 lines
652 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const crypto = require ('../../index');
|
||
|
|
||
|
describe ('hashing', () => {
|
||
|
it ('sha512', () => {
|
||
|
const hash = crypto.hash_sha512 ('a', 'b');
|
||
|
expect (
|
||
|
hash
|
||
|
)
|
||
|
.toEqual (
|
||
|
// eslint-disable-next-line max-len
|
||
|
'2d408a0717ec188158278a796c689044361dc6fdde28d6f04973b80896e1823975cdbf12eb63f9e0591328ee235d80e9b5bf1aa6a44f4617ff3caf6400eb172d'
|
||
|
);
|
||
|
});
|
||
|
|
||
|
it ('checksum', () => {
|
||
|
const hash = crypto.checksum ('foo');
|
||
|
expect (
|
||
|
hash
|
||
|
)
|
||
|
.toEqual (
|
||
|
// eslint-disable-next-line max-len
|
||
|
'2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae'
|
||
|
);
|
||
|
});
|
||
|
});
|