Created
April 26, 2024 15:04
-
-
Save hihumikan/14e5c92094ed52b6048ddd91523d0cc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
) | |
func main() { | |
targetHash := "" | |
for i := 0; i <= 999; i++ { | |
// 0埋めして3桁の数字文字列を作成 | |
numStr := fmt.Sprintf("%03d", i) | |
str := "HI2024_" + numStr | |
// 文字列をSHA256ハッシュに変換 | |
hash := sha256.Sum256([]byte(str)) | |
hashStr := hex.EncodeToString(hash[:]) | |
// ハッシュの比較 | |
if hashStr == targetHash { | |
fmt.Printf("Found matching hash for %s: %s\n", str, hashStr) | |
break | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment