Skip to content

Commit

Permalink
Create 32byte_hex.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
rswio authored Jan 26, 2025
1 parent eeb8ccc commit b89f4b1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Generators/32byte_hex.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Generate a random 32-byte array
$randomBytes = New-Object byte[] 32
[System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($randomBytes)

# Convert the byte array to a hexadecimal string
$hexString = -join ($randomBytes | ForEach-Object { "{0:X2}" -f $_ })

# Output the hexadecimal string
Write-Host "Random 32-byte Hexadecimal: $hexString"

0 comments on commit b89f4b1

Please sign in to comment.