Featured post

How to decode Tag-Length-Value Quickly

Basically, in TLV, the format is Tag, Length, and Value. In the list of protocols, TLV is one of the types. Transmitting the data depends on the protocol you used. However, many financial transactions still follow the TLV format. According to IBM, TLV data is three parts. The tag tells what type of data it is. The length field has a length of the value. The Value field has actual value.

Structure of TLV.TLV comprises three field values.  TagLengthValueEMV formulated different tags. They have their own meanings. Usually, the Tag and Length together takes 1 to 4 bytes.
The Best example for TLV.In the below example, you can find the sample TAG, LENGTH, and VALUE fields.

[Tag][Value Length][Value] (ex. "9F4005F000F0A001")
where

Tag Name = 9F40

Value Length (in bytes) = 05 
Value (Hex representation of bytes. Example, "F0" – 1-byte) = F000F0A001

In the above message, tag 9F40 has some meaning designed by EMV company. Here you can find a list of EMV Tags.
How to read the TLVTag: 1…

Python top two ideas you need to Compare Strings

In Python, you can compare two strings how you would do on numbers. Python is stricter on string comparison. It identifies any small differences in strings. So Python is case sensitive while comparing it checks for identical ones. 

  
Python follow-suite other languages. It compares strings for exact equals. Else, treat them as different strings.

Python String Comparison 

  • Extra spaces
  • Uppercase or Lowercase

#1 Example

>>> a = "Virginia"
>>> b = "virginia"
>>> a == b False 

The strings a and b are looking similar. But there is case sensitive difference. Python checks for extra white spaces as well as Upper or Lowe case letters.

#2 Example

>>> greet1 = "Hello "
>>> greet2 = "Hello"
>>> greet1  == greet2 False

The greet1 has space at the end whereas greet2 does not. Python looks at whitespace when comparing strings, so the two aren’t considered equal.

Comments

Popular posts from this blog

Hyperledger Fabric: 20 Real Interview Questions

How to Fix Python Syntax Errors Quickly

Tokenization: Vault based Vs Vault-less