Skip to content

Instantly share code, notes, and snippets.

@kyawswarthwin
Created September 16, 2025 19:34
Show Gist options
  • Select an option

  • Save kyawswarthwin/e6b576b70a6ae9535fff7fdf89302b9c to your computer and use it in GitHub Desktop.

Select an option

Save kyawswarthwin/e6b576b70a6ae9535fff7fdf89302b9c to your computer and use it in GitHub Desktop.
export function randomMyanmarIp(): string {
const prefixes: [number, number][] = [
[203, 81], // MPT
[103, 84], // Mytel
[45, 248], // Telenor
[202, 93], // Ooredoo
];
const prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
const bytes = new Uint8Array(2);
crypto.getRandomValues(bytes);
return `${prefix[0]}.${prefix[1]}.${bytes[0]}.${bytes[1]}`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment