u
This commit is contained in:
		
							parent
							
								
									4f23d79919
								
							
						
					
					
						commit
						a276bbe703
					
				
							
								
								
									
										7
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								index.js
									
									
									
									
									
								
							@ -650,7 +650,9 @@ class TICrypto {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      return address
 | 
					      return address
 | 
				
			||||||
    } else if (coin === 'BTC') {
 | 
					    } else if (coin === 'BTC') {
 | 
				
			||||||
      // 对比特币,把纯位置转换为大小写敏感能自我验证的bs58check地址:先加前缀1,再加校验4,共25字节,再转base58。得到26~34个字符,大多数34个。
 | 
					      // 对比特币,把纯位置转换为大小写敏感能自我验证的bs58check地址:先加前缀1节,再加校验4节,共25字节,再转base58。得到26~34个字符,大多数34个。
 | 
				
			||||||
 | 
					      // Base58: https://en.bitcoin.it/wiki/Base58Check_encoding
 | 
				
			||||||
 | 
					      // https://en.bitcoin.it/wiki/List_of_address_prefixes
 | 
				
			||||||
      let prefix
 | 
					      let prefix
 | 
				
			||||||
      switch (world) {
 | 
					      switch (world) {
 | 
				
			||||||
        case 'mainnet':
 | 
					        case 'mainnet':
 | 
				
			||||||
@ -680,11 +682,10 @@ class TICrypto {
 | 
				
			|||||||
      // 默认为 TIC。把纯位置转换为大小写敏感能自我验证的 b64u(base64 for url) 地址。
 | 
					      // 默认为 TIC。把纯位置转换为大小写敏感能自我验证的 b64u(base64 for url) 地址。
 | 
				
			||||||
      let prefix
 | 
					      let prefix
 | 
				
			||||||
      switch (world) {
 | 
					      switch (world) {
 | 
				
			||||||
        // Base58: https://en.bitcoin.it/wiki/List_of_address_prefixes
 | 
					 | 
				
			||||||
        // Base64: https://baike.baidu.com/item/base64
 | 
					        // Base64: https://baike.baidu.com/item/base64
 | 
				
			||||||
        case 'earth':
 | 
					        case 'earth':
 | 
				
			||||||
          prefix = '4c'
 | 
					          prefix = '4c'
 | 
				
			||||||
          break // Base58: 0x42=66 => T, Base64: base64 T=0x13=0b00010011 => 0b010011xx = 0x4c~4f
 | 
					          break // Base58: 0x42=66 => T, Base64: T=0x13=0b00010011 => 0b010011xx = 0x4c~4f
 | 
				
			||||||
        case 'moon':
 | 
					        case 'moon':
 | 
				
			||||||
          prefix = 'b4'
 | 
					          prefix = 'b4'
 | 
				
			||||||
          break // Base58: 0x7f=127,0x80=128 => t, Base64: t=0x2d=0b00101101 => 0b101101xx = 0xB4~B7
 | 
					          break // Base58: 0x7f=127,0x80=128 => t, Base64: t=0x2d=0b00101101 => 0b101101xx = 0xB4~B7
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user