mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 00:12:32 +02:00
hash util function
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const crypto = require('crypto');
|
||||
const yes = ['yes', 'y', 'ye', 'yeah', 'yup', 'yea'];
|
||||
const no = ['no', 'n', 'nah', 'nope'];
|
||||
|
||||
@@ -55,6 +56,10 @@ class Util {
|
||||
return Buffer.from(text).toString('base64');
|
||||
}
|
||||
|
||||
static hash(text, algorithm) {
|
||||
return crypto.createHash(algorithm).update(text).digest('hex');
|
||||
}
|
||||
|
||||
static cleanXML(text) {
|
||||
return text
|
||||
.replace(/<br \/>/g, '')
|
||||
|
||||
Reference in New Issue
Block a user