CrypocurrencyAddressValidation

我要开发同款
匿名用户2021年12月24日
88阅读

技术信息

系统类型
Web3
授权协议
MIT License

作品详情

CryptocurrecyAddressValidatioBTC,LTC,XMR

ThisisaPythoclasswhichperformsstrogvalidatioofdifferetcryptocurrecyaddresses,chais,adtickersymbols.Itwillesurethatthedataprovidedcalculatestoacorrectvalue,adissytacticallysafetouse.Segwitcompatible

ValidatioLevelsLegth-EsurethegiveaddressistheexpectedlegthCharacterSet-EsurethatolytheexpectedcharactersareuseditheaddressCharacterPositio-EsurethatcertaikeycharactersareitheirexpectedpositiositheaddressCryptographic-Decostructtheaddressitoitslogicalcompoets,advalidatethatitparsed,adaychecksumsorsigaturesarecorrect

ThislibraryperformsLevels1through4forallsupportedcoisadaddressformats

SupportedAddressFormatsBTC/LTC:P2PKH,P2SH,Bech32XMR:StadardAddress,Subaddress,ItegratedAddressStructure

Thislibraryhastwodepedecies:pysha3adbase58.Youusethislibrarybyimportigadcalligstaticmethodsithetop-levelValidatioclass.Coitickers,chais,adamesarecase-isesitive.AllfuctiosreturabooleaTrue/Falseaswer.

classValidatio:@staticmethoddefis_btc_chai(chai):...@staticmethoddefis_xmr_chai(chai):...@staticmethoddefis_coi_ticker(coi):...@staticmethoddefis_coi_ame(ame):...@staticmethoddefis_address(coi,address):...@staticmethoddefis_btc_address(address):...@staticmethoddefis_ltc_address(address):...@staticmethoddefis_xmr_address(address,label=Noe):...Usage:fromValidatioimportValidatioifValidatio.is_coi_ticker("BTC"):prit("Valid")ifValidatio.is_btc_chai("testet"):prit("Valid")ifValidatio.is_xmr_chai("stageet"):prit("Valid")ifValidatio.is_coi_ame("lITeCoiN"):prit("Valid")ifValidatio.is_address("BTC","3FkeCiXpSLqD8L79itRNXUgjRoH9sjXa"):prit("Valid")ifValidatio.is_address("BTC","bc1qar0srrr7xfkvy5l643lydw9re59gtzzwf5mdq"):prit("Valid")ifValidatio.is_address("LTC","LS78aoGtfuGCZ777x3Hmr6tcoW3WaYyx9"):prit("Valid")ifValidatio.is_address("XMR","46E5ekYrZd5UCcmNuYEX24FRjWVMgZ1ob79cRViyfvLFZjfyMhPDvbuCe54FqLQvVCgRKP4UUMMW5fy3ZhVQhD1JLLufBtu"):prit("Valid")Disclaimers

Iborrowed/modifiedcodefromtheseprojects:

Base58decodig:https://github.com/keis/base58P2PKHvalidatio:https://bit.ly/2DSVAXcBech32Validatio:https://bit.ly/2Eaw40NXMRValidatio:https://github.com/moero-project

Pleasetestthroughlybeforeusigthisiaproductioeviromet.Thereareowarraties,guaratees,orstrigsattachedwheusigthissoftware

FutureWorkItegratethebase58modulecodeitothelibraryitselfNamespacetheXMR,LTC,adBTCfuctios&classesCosolidateXMRadBTCbase58fuctiosMakethisitoa"real"PythomoduleadpublishtoPyPI

功能介绍

Cryptocurrency Address Validation BTC, LTC, XMR This is a Python class which performs strong vali...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论