Regular expression for matching RIPEMD hashes in strings.
~ ❯❯❯ npm install ripemd-regex
const ripemdRegex = require('ripemd-regex');
ripemdRegex().test('nodejsrocks 744fdac358014a96aedd7e87150c5a5e04a13001');
//=> true
ripemdRegex({exact: true}).test('nodejsrocks 744fdac358014a96aedd7e87150c5a5e04a13001 foo');
//=> false
ripemdRegex({exact: true}).test('744fdac358014a96aedd7e87150c5a5e04a13001');
//=> true
ripemdRegex.version(128, {exact: true}).test('3edc724c455361be0a366c838e7d2434');
//=> true
ripemdRegex.version(320, {exact: true}).test('744fdac358014a96aedd7e87150c5a5e04a13001');
//=> false
'nodejsrocks 744fdac358014a96aedd7e87150c5a5e04a13001 rainbow f4971074a8da200c122c04bc4e0fa96066913d6f38d3397eb61a7341078cd4841386e159993826af'.match(ripemdRegex());
//=> ['744fdac358014a96aedd7e87150c5a5e04a13001','f4971074a8da200c122c04bc4e0fa96066913d6f38d3397eb61a7341078cd4841386e159993826af']
Returns a regex for matching RIPEMD hashes.
Returns a regex for matching specific RIPEMD version hashes.
Type: integer
Supported Versions: 128
, 160
, 256
, 320
Match a specific version of RIPEMD.
Type: boolean
Default: false
(Matches any RIPEMD hash in a string)
Only match an exact string. Useful with RegExp#test()
to check if a string is a RIPEMD hash.
MIT © Nikolaos Kamarinakis