@@ -20,20 +20,20 @@ import { KeyGenerator } from '../../../src/core/format/KeyGenerator';
20
20
describe ( 'key generator' , ( ) => {
21
21
describe ( 'generate key from string' , ( ) => {
22
22
it ( 'throws if input is empty' , ( ) => {
23
- expect ( ( ) => KeyGenerator . fromString ( '' ) ) . to . throw ( Error , 'Input must not be empty' ) ;
23
+ expect ( ( ) => KeyGenerator . generateUInt64Key ( '' ) ) . to . throw ( Error , 'Input must not be empty' ) ;
24
24
} )
25
25
it ( 'returns UInt64' , ( ) => {
26
- expect ( KeyGenerator . fromString ( 'a' ) ) . to . be . instanceOf ( UInt64 ) ;
26
+ expect ( KeyGenerator . generateUInt64Key ( 'a' ) ) . to . be . instanceOf ( UInt64 ) ;
27
27
} )
28
28
it ( 'generates correct keys' , ( ) => {
29
- expect ( KeyGenerator . fromString ( 'a' ) . toHex ( ) ) . to . equal ( '80084BF2FBA02475 ' ) ;
29
+ expect ( KeyGenerator . generateUInt64Key ( 'a' ) . toHex ( ) ) . to . equal ( 'F524A0FBF24B0880 ' ) ;
30
30
} )
31
31
it ( 'generates keys deterministically' , ( ) => {
32
- expect ( KeyGenerator . fromString ( 'abc' ) . toHex ( ) ) . to . equal ( '3A985DA74FE225B2 ' ) ;
33
- expect ( KeyGenerator . fromString ( 'abc' ) . toHex ( ) ) . to . equal ( '3A985DA74FE225B2 ' ) ;
34
- expect ( KeyGenerator . fromString ( 'def' ) . toHex ( ) ) . to . equal ( '8E0D8F672252ACB0 ' ) ;
35
- expect ( KeyGenerator . fromString ( 'def' ) . toHex ( ) ) . to . equal ( '8E0D8F672252ACB0 ' ) ;
36
- expect ( KeyGenerator . fromString ( 'abc' ) . toHex ( ) ) . to . equal ( '3A985DA74FE225B2 ' ) ;
32
+ expect ( KeyGenerator . generateUInt64Key ( 'abc' ) . toHex ( ) ) . to . equal ( 'B225E24FA75D983A ' ) ;
33
+ expect ( KeyGenerator . generateUInt64Key ( 'abc' ) . toHex ( ) ) . to . equal ( 'B225E24FA75D983A ' ) ;
34
+ expect ( KeyGenerator . generateUInt64Key ( 'def' ) . toHex ( ) ) . to . equal ( 'B0AC5222678F0D8E ' ) ;
35
+ expect ( KeyGenerator . generateUInt64Key ( 'def' ) . toHex ( ) ) . to . equal ( 'B0AC5222678F0D8E ' ) ;
36
+ expect ( KeyGenerator . generateUInt64Key ( 'abc' ) . toHex ( ) ) . to . equal ( 'B225E24FA75D983A ' ) ;
37
37
} )
38
38
} )
39
39
} ) ;
0 commit comments