修复Hmac误用
Some checks failed
Deploy Original / deploy (push) Has been cancelled

This commit is contained in:
ProjectXero 2024-10-13 00:30:24 +08:00
parent 9b3681c2b0
commit 0c5e335b27
No known key found for this signature in database
GPG Key ID: 5B1AA72F4425593E
17 changed files with 24 additions and 24 deletions

View File

@ -1,4 +1,4 @@
const { createHmac } = require('crypto');
const { createHash } = require('crypto');
const { mkdirSync, writeFileSync, existsSync, readFileSync } = require('fs');
const { resolve: resolvePath } = require('path');
const { SyntaxKind } = require('ts-morph');
@ -20,7 +20,7 @@ const ExampleNameOverwrite = [
];
function hashTextShort(str) {
return createHmac('sha256', str).digest('hex').slice(0, 8);
return createHash('sha256').update(str).digest('hex').slice(0, 8);
}
const examples = {};

View File

@ -215,7 +215,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link GameTestError}
* @seeExample simpleMobTest.ts 383d6e87
* @seeExample simpleMobTest.ts 582539d0
*/
assertEntityInstancePresentInArea(entity: minecraftserver.Entity, isPresent?: boolean): void;
/**
@ -264,7 +264,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link GameTestError}
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
assertEntityPresentInArea(entityTypeIdentifier: string, isPresent?: boolean): void;
/**
@ -773,8 +773,8 @@ export class Test {
* @throws This function can throw errors.
*
* {@link minecraftserver.GameTestError}
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample spawnAdultPig.js 6a962333
* @seeExample simpleMobTest.ts 3a296de4
* @seeExample spawnAdultPig.js ca50f0aa
*/
spawn(entityTypeIdentifier: string, blockLocation: minecraftserver.Vector3): minecraftserver.Entity;
/**
@ -794,7 +794,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link minecraftserver.GameTestError}
* @seeExample spawnAdultPig.js 5ea5c8ce
* @seeExample spawnAdultPig.js b52912dc
*/
spawnAtLocation(entityTypeIdentifier: string, location: minecraftserver.Vector3): minecraftserver.Entity;
/**
@ -966,7 +966,7 @@ export class Test {
* Testing callback function that runs. If the function runs
* successfully, the test is marked as a success.
* @throws This function can throw errors.
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
succeedWhen(callback: () => void): void;
/**

View File

@ -20,7 +20,7 @@
* Returns a {@link RegistrationBuilder} object where
* additional options for this test can be specified via
* builder methods.
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
export function register(
testClassName: string,

View File

@ -301,7 +301,7 @@ export class Block {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample check_block_tags.js ceb2537b
* @seeExample check_block_tags.js d8a9d838
*/
hasTag(tag: string): boolean;
/**

View File

@ -61,7 +61,7 @@ export class BlockPermutation {
*
* @returns
* Returns `true` if the permutation has the tag, else `false`.
* @seeExample check_block_tags.js 4ba7d631
* @seeExample check_block_tags.js 25c0e459
*/
hasTag(tag: string): boolean;
/**

View File

@ -456,7 +456,7 @@ export class Dimension {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample spawnParticle.ts 5deb9e00
* @seeExample spawnParticle.ts 4689acc9
*/
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
}

View File

@ -327,7 +327,7 @@ export class Player extends Entity {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample spawnParticle.ts 6dbd8500
* @seeExample spawnParticle.ts bdc4b9e7
*/
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
/**

View File

@ -1201,7 +1201,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link GameTestError}
* @seeExample simpleMobTest.ts 383d6e87
* @seeExample simpleMobTest.ts 582539d0
*/
assertEntityInstancePresentInArea(entity: minecraftserver.Entity, isPresent?: boolean): void;
/**
@ -1250,7 +1250,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link GameTestError}
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
assertEntityPresentInArea(entityTypeIdentifier: string, isPresent?: boolean): void;
/**
@ -1759,8 +1759,8 @@ export class Test {
* @throws This function can throw errors.
*
* {@link minecraftserver.GameTestError}
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample spawnAdultPig.js 6a962333
* @seeExample simpleMobTest.ts 3a296de4
* @seeExample spawnAdultPig.js ca50f0aa
*/
spawn(entityTypeIdentifier: string, blockLocation: minecraftserver.Vector3): minecraftserver.Entity;
/**
@ -1780,7 +1780,7 @@ export class Test {
* @throws This function can throw errors.
*
* {@link minecraftserver.GameTestError}
* @seeExample spawnAdultPig.js 5ea5c8ce
* @seeExample spawnAdultPig.js b52912dc
*/
spawnAtLocation(entityTypeIdentifier: string, location: minecraftserver.Vector3): minecraftserver.Entity;
/**
@ -1952,7 +1952,7 @@ export class Test {
* Testing callback function that runs. If the function runs
* successfully, the test is marked as a success.
* @throws This function can throw errors.
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
succeedWhen(callback: () => void): void;
/**
@ -2178,7 +2178,7 @@ export class GameTestError extends Error {
* Returns a {@link RegistrationBuilder} object where
* additional options for this test can be specified via
* builder methods.
* @seeExample simpleMobTest.ts fc1293e3
* @seeExample simpleMobTest.ts 3a296de4
*/
export function register(
testClassName: string,

View File

@ -2853,7 +2853,7 @@ export class Block {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample check_block_tags.js ceb2537b
* @seeExample check_block_tags.js d8a9d838
*/
hasTag(tag: string): boolean;
/**
@ -3482,7 +3482,7 @@ export class BlockPermutation {
*
* @returns
* Returns `true` if the permutation has the tag, else `false`.
* @seeExample check_block_tags.js 4ba7d631
* @seeExample check_block_tags.js 25c0e459
*/
hasTag(tag: string): boolean;
/**
@ -5692,7 +5692,7 @@ export class Dimension {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample spawnParticle.ts 5deb9e00
* @seeExample spawnParticle.ts 4689acc9
*/
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
}
@ -11928,7 +11928,7 @@ export class Player extends Entity {
* {@link LocationInUnloadedChunkError}
*
* {@link LocationOutOfWorldBoundariesError}
* @seeExample spawnParticle.ts 6dbd8500
* @seeExample spawnParticle.ts bdc4b9e7
*/
spawnParticle(effectName: string, location: Vector3, molangVariables?: MolangVariableMap): void;
/**