add IPv6 ULA generators
This commit is contained in:
		
							
								
								
									
										17
									
								
								generate-ula48.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								generate-ula48.py
									
									
									
									
									
										Executable file
									
								
							@ -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 )
 | 
			
		||||
		Reference in New Issue
	
	Block a user