Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

一个Go程序,把mac地址转换成hostname #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

wangkuiyi
Copy link

设计文档请看 README.md。

We can run the program as a command line tool:

$ go get github.com/k8sp/mac-to-host
$ $GOPATH/bin/mac-to-host ac:29:3a:9c:aa:d5
heavily-calm-fake-adept-blind-back

Or, we can run it as an HTTP server:

$ $GOPATH/bin/mac-to-host -http="0.0.0.0:12340" &
$ curl http://127.0.0.1:12340/ac:29:3a:9c:aa:d5
heavily-calm-fake-adept-blind-back


The following Bash command eliminates words containing non
alphabetical letters and choose the shortest 255 of them:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么不是 256?我看了下 wiki 上的介绍,似乎并没有保留 ff 不用。

本文后边的 255, 1020,以及 selected-words.go 中数组的长度,不再一一 comment 了。

@jiamliang
Copy link

我在本地运行了,没有问题。
也看了一遍代码,写的很简洁。
LGTM

@pineking
Copy link

为什么不直接用MAC地址当做hostname?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants