bug修复
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
3b8712a212
commit
594fbdc75b
|
@ -8,7 +8,7 @@ name: test
|
|||
|
||||
steps:
|
||||
- name: install
|
||||
image: node16-alpine
|
||||
image: node:16
|
||||
commands:
|
||||
- yarn install
|
||||
- yarn test
|
||||
|
|
|
@ -19,7 +19,7 @@ export function uuid(input) {
|
|||
|
||||
export function noSymboUUID(input) {
|
||||
let md5Bytes = Crypto.createHash('md5').update(input).digest()
|
||||
md5Bytes[6] &= 0x0f; // clear version
|
||||
md5Bytes[6] &= 0x0f; // clear versio\n
|
||||
md5Bytes[6] |= 0x30; // set to version 3
|
||||
md5Bytes[8] &= 0x3f; // clear variant
|
||||
md5Bytes[8] |= 0x80; // set to IETF variant
|
||||
|
@ -27,7 +27,7 @@ export function noSymboUUID(input) {
|
|||
}
|
||||
|
||||
export function uuidToNoSymboUUID(uuid) {
|
||||
return uuid.replace('-', '')
|
||||
return uuid.replace(/-/g, '')
|
||||
}
|
||||
|
||||
export function toSymboUUID(uuid) {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
import * as Server from './index.js'
|
||||
|
||||
console.log(Server)
|
|
@ -13,3 +13,19 @@ test("generateToken", () => {
|
|||
|
||||
expect(new Set(tokens).size === tokens.length).toBeTruthy()
|
||||
})
|
||||
|
||||
test("uuid", () => {
|
||||
expect(Generator.uuid("test")).toBe("098f6bcd-4621-3373-8ade-4e832627b4f6")
|
||||
})
|
||||
|
||||
test("noSymbolUUID", () => {
|
||||
expect(Generator.noSymboUUID("test")).toBe("098f6bcd462133738ade4e832627b4f6")
|
||||
})
|
||||
|
||||
test("uuidToNoSymboUUID", () => {
|
||||
expect(Generator.uuidToNoSymboUUID("098f6bcd-4621-3373-8ade-4e832627b4f6")).toBe("098f6bcd462133738ade4e832627b4f6")
|
||||
})
|
||||
|
||||
test("toSymboUUID", () => {
|
||||
expect(Generator.toSymboUUID("098f6bcd462133738ade4e832627b4f6")).toBe("098f6bcd-4621-3373-8ade-4e832627b4f6")
|
||||
})
|
Loading…
Reference in New Issue