add IPv6 ULA generators

master
Marek Isalski 2 years ago
parent 095d33dfbf
commit b0999adf5d

@ -0,0 +1,17 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Generate RFC 4193 ULA Locally Assigned Address Block /48
# @raycast.mode silent
# @raycast.packageName Developer Utilities
# Optional parameters:
# @raycast.icon 💻
import os, binascii, subprocess
prefix = "fd" + binascii.b2a_hex( os.urandom( 5 ) ).decode( "utf-8" )
prefix = prefix[ 0:4 ] + ":" + prefix[ 4:8 ] + ":" + prefix[ 8:12 ] + "::/48"
subprocess.run( [ "/usr/bin/pbcopy" ], input = prefix.encode( "utf-8" ) )
print( prefix )

@ -0,0 +1,17 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Generate RFC 4193 ULA Locally Assigned Address Block /56
# @raycast.mode silent
# @raycast.packageName Developer Utilities
# Optional parameters:
# @raycast.icon 💻
import os, binascii, subprocess
prefix = "fd" + binascii.b2a_hex( os.urandom( 6 ) ).decode( "utf-8" ) + "00"
prefix = prefix[ 0:4 ] + ":" + prefix[ 4:8 ] + ":" + prefix[ 8:12 ] + ":" + prefix[ 12:16 ] + "::/56"
subprocess.run( [ "/usr/bin/pbcopy" ], input = prefix.encode( "utf-8" ) )
print( prefix )

@ -0,0 +1,17 @@
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Generate RFC 4193 ULA Locally Assigned Address Block /64
# @raycast.mode silent
# @raycast.packageName Developer Utilities
# Optional parameters:
# @raycast.icon 💻
import os, binascii, subprocess
prefix = "fd" + binascii.b2a_hex( os.urandom( 7 ) ).decode( "utf-8" )
prefix = prefix[ 0:4 ] + ":" + prefix[ 4:8 ] + ":" + prefix[ 8:12 ] + ":" + prefix[ 12:16 ] + "::/64"
subprocess.run( [ "/usr/bin/pbcopy" ], input = prefix.encode( "utf-8" ) )
print( prefix )
Loading…
Cancel
Save