Last active
June 6, 2020 17:41
-
-
Save cfc1020/270a9e3198cebc582304471676b24e75 to your computer and use it in GitHub Desktop.
Defanging an IP Address
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @param {String} address | |
# @return {String} | |
def defang_i_paddr(address) | |
address.split('.').join('[.]') | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @param {String} address | |
# @return {String} | |
def defang_i_paddr2(address) | |
address.gsub('.', '[.]') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment