From 53ee173426ecfe355fa61cdf94db9cc27f4893c6 Mon Sep 17 00:00:00 2001 From: Akkariin Meiko Date: Sun, 23 Jun 2019 22:42:10 +0800 Subject: [PATCH] Create supermicro.php --- supermicro.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 supermicro.php diff --git a/supermicro.php b/supermicro.php new file mode 100644 index 0000000..aeae8d7 --- /dev/null +++ b/supermicro.php @@ -0,0 +1,43 @@ +getBin($dmac), hex2bin('8544E3B47ECA58F9583043F8')), 0, 24); + } + + public function getLicense($mac, $source = false) + { + $mac = str_replace(":", "", $mac); + if(preg_match("/^[a-z0-9]{12}$/", $mac)) { + $key = $this->getKey($mac); + if(empty($key)) { + return false; + } + if($source) { + return $key; + } + $s = 0; + $result = ""; + for($i = 0;$i < strlen($key);$i++) { + $s++; + $result .= $key[$i]; + if($s == 4 && $i !== strlen($key) - 1) { + $result .= "-"; + $s = 0; + } + } + return $result; + } + return false; + } +}