一般涉及到硬件出厂的,都会有一个唯一 ID 来标记这个硬件,最近项目也涉及到了这块。硬件的同事会通过串口,给我们一串字节(12 个 byte),他们可以保证这 12 个 byte 的序列是唯一的,所以在 App 层面,我们使用这串字节,转成相应的十六进制的字符串,作为业务层的唯一 ID。转换代码如下:
1 | StringBuilder builder = new StringBuilder(); |
缺失模块。
1、在博客根目录(注意不是yilia根目录)执行以下命令:
npm i hexo-generator-json-content --save
2、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: true
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true