You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if someone create a validation rule for ASN (Autonomous System Number) based on the RFC.
"There are two different formats to represent ASNs: 2-byte and 4-byte.
A 2-byte ASN is a 16-bit number. This format provides for 65,536 ASNs (0 to 65535). From these ASNs, the Internet Assigned Numbers Authority (IANA) reserved 1,023 of them (64512 to 65534) for private use.
A 4-byte ASN is a 32-bit number. This format provides for 232 or 4,294,967,296 ASNs (0 to 4294967295). IANA reserved a block of 94,967,295 ASNs (4200000000 to 4294967294) for private use.
Up until the Internet Engineering Task Force (IETF) proposed a gradual transition to 4-byte ASNs in 2007, all ASNs were 2-byte. There is no longer a distinction between a 2-byte and 4-byte ASN, and all ASNs should be considered 4-byte."
Some examples could be: v::asn()->validate('4230'); // true v::asn()->validate('AS4230'); // true (case insensitive) v::asn()->validate('ASN4230'); // false (not valid to use "ASN", just AS or just the number) v::asn('AS4230')->private(); // false v::asn('4294967294')->private(); // true v::asn('65534')->private(); //true
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It would be great if someone create a validation rule for ASN (Autonomous System Number) based on the RFC.
"There are two different formats to represent ASNs: 2-byte and 4-byte.
A 2-byte ASN is a 16-bit number. This format provides for 65,536 ASNs (0 to 65535). From these ASNs, the Internet Assigned Numbers Authority (IANA) reserved 1,023 of them (64512 to 65534) for private use.
A 4-byte ASN is a 32-bit number. This format provides for 232 or 4,294,967,296 ASNs (0 to 4294967295). IANA reserved a block of 94,967,295 ASNs (4200000000 to 4294967294) for private use.
Up until the Internet Engineering Task Force (IETF) proposed a gradual transition to 4-byte ASNs in 2007, all ASNs were 2-byte. There is no longer a distinction between a 2-byte and 4-byte ASN, and all ASNs should be considered 4-byte."
Read more here: https://www.arin.net/resources/guide/asn/
Some examples could be:
v::asn()->validate('4230'); // true v::asn()->validate('AS4230'); // true (case insensitive) v::asn()->validate('ASN4230'); // false (not valid to use "ASN", just AS or just the number) v::asn('AS4230')->private(); // false v::asn('4294967294')->private(); // true v::asn('65534')->private(); //true
Beta Was this translation helpful? Give feedback.
All reactions