Replies: 1 comment 2 replies
-
I would be very open for that validator. Is that something you would like to implement yourself? I can help you with how to get it to fit in this library. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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