19 lines
334 B
TypeScript
19 lines
334 B
TypeScript
import { createHash } from 'crypto';
|
|
|
|
export interface AuctionRedisScriptDefinition {
|
|
lua: string;
|
|
name: string;
|
|
sha: string;
|
|
}
|
|
|
|
export function defineAuctionRedisScript(
|
|
name: string,
|
|
lua: string,
|
|
): AuctionRedisScriptDefinition {
|
|
return {
|
|
lua,
|
|
name,
|
|
sha: createHash('sha1').update(lua).digest('hex'),
|
|
};
|
|
}
|