Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
斗地主工具包,功能正在陆续开发中
npm i ddz -S
import ddz from 'ddz'
<script src="//unpkg.com/ddz"></script>
创建一张牌
ddz.card('K', 3) // 0xB3
ddz.card(3, 4) // 0x14
获取一副新牌,从小到大,黑红梅方
ddz.cards() // [17, 18, 19, 20, 33, 34, 35, 36, 49, 50, 51, 52, 65, 66, 67, 68, 81, 82, 83, 84, 97, 98, 99, 100, 113, 114, 115, 116, 129, 130, 131, 132, 145, 146, 147, 148, 161, 162, 163, 164, 177, 178, 179, 180, 193, 194, 195, 196, 209, 210, 211, 212, 224, 240]
获取指定牌型的长度
ddz.length('炸弹') // 4
ddz.length('七张顺子') // 7
ddz.length('三连飞机带三对') // 15
获取指定牌的点数
ddz.point(0x62) // 6
ddz.point(0xD1) // 13
ddz.point('K') // 11
获取指定点数的牌面
ddz.surface(10) // 'Q'
ddz.surface(12) // 'A'
ddz.surface(ddz.point(0x91)) // 'J'
获取指定牌的花色
ddz.suit(0x91) // 1
ddz.suit(0xD4) // 4
ddz.suit(0xE0) // 0
获取当前库版本号
ddz.version() // '0.1.0'
单词 | 名词 | 范围 | 解释 |
---|---|---|---|
point | 点数 | 1 ~ 15 | 牌的大小,用于判断 |
card | 牌值 | 0x11 ~ 0xF0 | 牌的数值形式,用于排序 |
surface | 牌面 | 34567890JQKA2XD | 牌的文字表示,用于展示 |
suit | 花色 | 0 ~ 5 | 王牌和黑红梅方花色,用于展示或排序 |
FAQs
The npm package ddz receives a total of 0 weekly downloads. As such, ddz popularity was classified as not popular.
We found that ddz demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.