https://blog.elmah.io/convert-images-to-webp-with-asp-net-core-better-than-png-jpg-files/
npm install node-machine-id
//有 异步,同步 两种生成方式
import {machineId, machineIdSync} from 'node-machine-id';
// async await 同步使用方法
async function getMachineId() {
let id = await machineId();
...
}
//也可以直接then执行下面操作id为生成的唯一id
machineId().then((id) => {
...
})
let id = machineIdSync()
// id = c24b0fe51856497eebb6a2bfcd120247aac0d6334d670bb92e09a00ce8169365
//original:如果为true,则返回计算机ID的原始值,否则返回哈希值(sha-256)
let id = machineIdSync({original: true})
// id = 98912984-c4e9-5ceb-8000-03882a0485e4
WebP, ASP.NET, Core, 图片转换, 性能优化
学习如何在ASP.NET Core中将图片转换为WebP格式,提高网页加载速度,优化用户体验。