本文整理汇总了Python中pyndn.Interest.nonce方法的典型用法代码示例。如果您正苦于以下问题:Python Interest.nonce方法的具体用法?Python Interest.nonce怎么用?Python Interest.nonce使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyndn.Interest
的用法示例。
在下文中一共展示了Interest.nonce方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Interest
# 需要导入模块: from pyndn import Interest [as 别名]
# 或者: from pyndn.Interest import nonce [as 别名]
from pyndn import Interest, Name, Key, NDN, _pyndn
import datetime
k = NDN.getDefaultKey()
i = Interest()
i.name = Name('/hello/world')
i.minSuffixComponents = 2
i.maxSuffixComponents = 4
i.publisherPublicKeyDigest = k.publicKeyID
i.exclude = None
i.childSelector = 1
i.answerOriginKind = 4
i.scope = 2
i.interestLifetime = 30.0
i.nonce = b'abababa'
print(i)
print(i.ndn_data)
i2 = _pyndn.Interest_obj_from_ndn(i.ndn_data)
print(i2)
assert(i.name == i2.name)
assert(i.minSuffixComponents == i2.minSuffixComponents)
assert(i.maxSuffixComponents == i2.maxSuffixComponents)
assert(i.publisherPublicKeyDigest == i2.publisherPublicKeyDigest)
assert(i.exclude == i2.exclude)
assert(i.childSelector == i2.childSelector)
assert(i.scope == i2.scope)
assert(i.interestLifetime == i2.interestLifetime)