(str: string)
| 20 | |
| 21 | // Hash a string using the djb2 algorithm. |
| 22 | export const hashString = (str: string): string => { |
| 23 | let hash = 5381; |
| 24 | for (let i = 0; i < str.length; i++) { |
| 25 | const char = str.charCodeAt(i); |
| 26 | hash = (hash << 5) - hash + char; |
| 27 | hash = hash & hash; |
| 28 | } |
| 29 | return hash.toString(); |
| 30 | }; |
| 31 | |
| 32 | export const gitTagExists = (tag: string): boolean => { |
| 33 | const output = execSync(`git tag --list "${tag}"`).toString().trim(); |