feat(misc): add rand-ip command to insert a random IPv4 address

This commit is contained in:
2020-10-29 10:43:45 +00:00
parent f5405690b4
commit 3edd57c753

View File

@@ -38,5 +38,13 @@
(dotimes (_ (if (numberp NUM) (abs NUM) 16 ))
(insert (elt charset (random baseCount))))))
(defun rand-ip ()
"Insert a random IPv4 address."
(interactive)
(insert (concat (int-to-string (random 255))
"." (int-to-string (random 255))
"." (int-to-string (random 255))
"." (int-to-string (random 255)))))
(provide 'siren-rand)
;;; siren-rand.el ends here